package com.xaicode.learn.java.multithreadarch.ch2;

/**
 * @author Locker cjxia@isoftstone.com
 * @version 1.0
 */
public class ThreadConstruction {

    public static void main(String[] args) {

        Thread t1 = new Thread("t1");

        ThreadGroup group = new ThreadGroup("TG");

        Thread t2 = new Thread(group, "t2");
        ThreadGroup mainThreadGroup = Thread.currentThread().getThreadGroup();

        System.out.println(t1.getThreadGroup());
        System.out.println(t2.getThreadGroup());
        System.out.println(mainThreadGroup.getName());
        System.out.println(group.getName());

    }

}
